<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id='input'>
    <p id="p"></p>
    <script>
        let input=document.getElementById('input')
        let p=document.getElementById('p')
        const newObj=new Proxy({},{
            get:function(target,key,receiver){
                return Reflect.get(target,key,receiver)
            },
            set:function(target,key,value,receiver){
                if(key === 'text'){
                    input.value=value
                    p.innerHTML=value
                }
                return Reflect.set(target,key,value,receiver)
            }
        })
        input.addEventListener('keyup',function(e){
            newObj.text=e.target.value
            console.log(newObj)
        })

    </script>
</body>
</html>